
cc.Class({
    extends: cc.Component,

    properties: {
        time: cc.Label
    },


    onLoad () {
        this.init()
    },

    
    start(){
        this.callback = function () {
            if(this.num > 0){
                this.num--
                this.time.string = this.num
            }
        }
        this.schedule(this.callback, 1);
    },

    init(){
        this.node.zIndex = 4
        this.num = 5
        this.time.string = this.num
    },
  

    closeAd(){
        this.node.active = false
        if(this.num > 0 ) {
            game.jGameOver.over(false)
        }else {
            cc.log("复活了")
            game.jHreo.rebirth()
        }
        this.init()
        cc.audioEngine.resume(game.bgmId) 

    }


 
});
